﻿Imports VaRTools.GUI.FRM

Public Class mdiVaRTools

    Private Sub Ventana(ByVal F As Object)
        Me.Cursor = Cursors.WaitCursor
        ' Make the new form a child form.
        F.MdiParent = Me
        ' Display the child form.
        F.Show()
        Me.Cursor = Cursors.Default
    End Sub

    Private Sub tsbCargar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbCargar.Click
        Dim f As New frmCarga
        Ventana(f)
    End Sub

    Private Sub tsbParametros_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbParametros.Click
        Dim f As New frmParametrosSim
        Ventana(f)
    End Sub

    Private Sub tsbGestionar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbGestionar.Click
        Dim f As New frmGestionarPort
        Ventana(f)
    End Sub

    Private Sub tsbMatriz_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbMatriz.Click
        Dim f As New frmMatrizVaCo
        Ventana(f)
    End Sub

    Private Sub tsbCalcular_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbCalcular.Click
        Dim f As New frmCalcularVaR
        Ventana(f)
    End Sub

    Private Sub tsbFeriados_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbFeriados.Click
        Dim f As New frmCalendarioFeriados
        Ventana(f)
    End Sub

    Private Sub tsbDataManager_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbDataManager.Click
        Dim f As New frmDataManager
        Ventana(f)
    End Sub

    Private Sub mdiVaRTools_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim intX As Integer = Screen.PrimaryScreen.Bounds.Width
        Dim intY As Integer = Screen.PrimaryScreen.Bounds.Height

        If intX = 1024 And intY = 768 Then

            'Me.BackgroundImage = System.Drawing.Image.FromFile("D:\VARSolution\VaRTools.GUI.WIN\Resources\VAR1024x768.png")
            Me.BackgroundImage = My.Resources.VAR2 ' .VAR1024x768

        End If

    End Sub

    Private Sub tsbUndGestion_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbUndGestion.Click
        Dim f As New frmUndsGestion
        Ventana(f)
    End Sub

    Private Sub tsbFactoresInstrumento_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbFactoresInstrumento.Click
        Dim f As New frmFactorInstrumento
        Ventana(f)
    End Sub

    Private Sub tsbAsignarLimites_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbAsignarLimites.Click
        Dim f As New frmAsignarLimites
        Ventana(f)
    End Sub

    Private Sub tsbAutonomias_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbAutonomias.Click
        Dim f As New frmAutonomias
        Ventana(f)
    End Sub

    Private Sub tsbPrueba_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbPrueba.Click
        Dim f As New Form1
        Ventana(f)
    End Sub
End Class
